#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
char result[50] = {0};
char buf[1024] = {0};

void my_system(const char* cmd) {
    FILE* fp = NULL;
    if ((fp = popen(cmd, "r")) == NULL) {
        printf("popen error!\n");
        return;
    }
    while (fgets(buf, sizeof(buf), fp)) {
        strcat(result, buf);
    }
    pclose(fp);
}

int main(int argc, char const* argv[]) {
    char *cmdWorking = "check.exe --checkWorking 1";
    char *cmdTryMode = "check.exe --checkTryMode 1"; 
    char *cmdEndDate = "check.exe --checkEndDate 1";
    char *cmdActivate = "check.exe --activate ";
    // 获取机器状态和ID
    my_system(cmdWorking);
    printf("%s\n", result);

    printf("如果要输入注册码");
    
    return 0;
}